<template name="grainPowerboxCard">
  {{ grainInfo.title }}
</template>

<template name="uiViewPowerboxConfiguration">
  {{#if choseHostedObject}}
    <div class="powerbox-iframe-mount">{{ setupIframe }}</div>
  {{else}}
    <form>
      <p>{{_ "powerboxBuiltins.uiViewPowerboxConfiguration.explanation"}}</p>
      {{#each role in viewInfo.roles}}
        <label><input type="radio" name="role" value="{{role.index}}">{{role.title.defaultText}} - {{role.verbPhrase.defaultText}}</label>
      {{else}}
        <label><input type="radio" checked="true" name="role" value="all">{{_ "powerboxBuiltins.uiViewPowerboxConfiguration.fullAccess"}}</label>
      {{/each}}
      <div class="choose-buttons">
        <button class="connect-button">{{_ "powerboxBuiltins.uiViewPowerboxConfiguration.connectButton"}}</button>
        {{#if option.hostedObject}}
          <button class="choose-hosted-object">{{_ "powerboxBuiltins.uiViewPowerboxConfiguration.chooseHostedObjectButton"}}</button>
        {{/if}}
      </div>
    </form>
  {{/if}}
</template>

<template name="ipNetworkPowerboxCard">
  {{_ "powerboxBuiltins.ipNetworkPowerboxCard.explanation"}}
  {{#with encryption}}
    {{_ "powerboxBuiltins.ipNetworkPowerboxCard.encryptedWith" .}}
  {{/with}}
</template>

<template name="ipInterfacePowerboxCard">
  {{_ "powerboxBuiltins.ipInterfacePowerboxCard.explanation"}}
</template>

<template name="emailVerifierPowerboxCard">
  {{#if option.frontendRef.emailVerifier.services}}
    {{_ "powerboxBuiltins.emailVerifierPowerboxCard.verifyWith" serviceTitle}}
  {{else}}
    {{_ "powerboxBuiltins.emailVerifierPowerboxCard.verifyWithAnyService"}}
  {{/if}}
</template>

<template name="verifiedEmailPowerboxCard">
  {{ option.frontendRef.verifiedEmail.address }}
</template>

<template name="identityPowerboxCard">
  {{ option.profile.name }}
</template>

<template name="identityPowerboxConfiguration">
  <form>
    <p>{{_ "powerboxBuiltins.identityPowerboxConfiguration.explanation"}}</p>
    {{#each role in sufficientRoles}}
      <label><input type="radio" name="role" value="{{role.index}}">{{role.title.defaultText}} - {{role.verbPhrase.defaultText}}</label>
    {{else}}
      <label><input type="radio" checked="true" name="role" value="all">{{_ "powerboxBuiltins.identityPowerboxConfiguration.fullAccess"}}</label>
    {{/each}}
    <div class="choose-buttons">
      <button class="connect-button">{{_ "powerboxBuiltins.identityPowerboxConfiguration.connectButton"}}</button>
    </div>
  </form>
</template>

<template name="addNewVerifiedEmailPowerboxCard">
  {{_ "powerboxBuiltins.addNewVerifiedEmailPowerboxCard.explanation"}}
</template>

<template name="httpUrlPowerboxCard">
  {{_ "powerboxBuiltins.httpUrlPowerboxCard.useUrl" option.frontendRef.http.url}}
</template>

<template name="httpArbitraryPowerboxCard">
  {{_ "powerboxBuiltins.httpArbitraryPowerboxCard.explanation"}}
</template>

<template name="httpArbitraryPowerboxConfiguration">
  <form>
    {{_ "powerboxBuiltins.httpArbitraryPowerboxConfiguration.explanation"}}
    <input class="url" type="text" placeholder="{{_ "powerboxBuiltins.httpArbitraryPowerboxConfiguration.placeholder"}}">
    <div class="choose-buttons">
      <button class="connect-button">{{_ "powerboxBuiltins.httpArbitraryPowerboxConfiguration.connectButton"}}</button>
    </div>
  </form>
</template>

<template name="httpOAuthPowerboxCard">
  {{_ "powerboxBuiltins.httpOAuthPowerboxCard.useService" option.oauthServiceInfo.service}}
</template>

<template name="httpOAuthPowerboxConfiguration">
  {{_ "powerboxBuiltins.httpOAuthPowerboxConfiguration.requestPermissionsFromService" option.oauthServiceInfo.service}}
</template>
